<template>
	<view>
		<view class="tui-mybg-box">
			<view class="tui-header-center">
				<view class="avatar">
					<image src="../../../static/Mine/5.png" class="tui-avatar"></image>
				</view>
				<view class="headerinfo">
					<view class="headernickname">呢称</view>
					<view class="u-flex">
						<button class="bdphone">绑定手机号码</button>
						<navigator url="../personaledit/personaledit">
							<!-- <view class="headernum"> -->
								<image src="../../../static/Mine/set.png" style="width: 35rpx;height: 35rpx;" class="headernum">
								</image>
							<!-- </view> -->
						</navigator>
					</view>
				</view>
			</view>
		</view>
		<view class="section-1">
			<navigator class="item" open-type="navigate" url="/pages/Mine/personal/balance" hover-class="none">
				<view class="text-color-assist">我的余额</view>
				<view class="text2">0.00</view>
			</navigator>
			<navigator class="item" open-type="navigate" url="/pages/Mine/share/share" hover-class="none">
				<view class="text-color-assist">当前佣金</view>
				<view class="text2">0</view>
			</navigator>
			<navigator class="item" open-type="navigate" url="/pages/shop/coupon" hover-class="none">
				<view class="text-color-assist">优惠券</view>
				<view class="text2">0</view>
			</navigator>
		</view>
		<view class="section-2">
			<view class="header">
				<view class="headertitle">我的订单</view>
				<navigator url="../orderList/orderList">
					<view class="subtitle">全部订单
						<text class="iconfont icon-right" style="font-size: 25rpx; margin-right: 10rpx;"></text>
					</view>
				</navigator>

			</view>
			<view class="row">
				<navigator class="grid" open-type="navigate" url="/pages/integrals/mall" v-for="(item,index) in list"
					:key="index" hover-class="none">
					<view class="tip" v-if="item.num>0">{{item.num}}</view>
					<image :src="item.image"></image>
					<view class="title">{{item.title}}</view>
				</navigator>
			</view>
		</view>
		<view class="section-3">
			<view class="header3">
				<view class="headertitle3">我的服务</view>
			</view>
			<view class="row3">
				<block v-for="(item,index) in list2" :key="index">
					<navigator class="grid3" open-type="navigate" :url="item.url" hover-class="none">
						<image :src="item.image"></image>
						<view class="title3">{{item.title}}</view>
					</navigator>
				</block>

			</view>
		</view>
	</view>
</template>
<script>
	import {
		userdetail
	} from '@/api/mine.js'
	export default {
		data() {
			return {
				list: [{
						title: '待付款',
						image: '../../../static/Mine/daifukuan2.png',
						num: '02',
					},
					{
						title: '待发货',
						image: '../../../static/Mine/dingdan-daishouhuo.png',
						num: '08',
					},
					{
						title: '待收货',
						image: '../../../static/Mine/shouhuoshou--.png',
						num: '0',
					},
					{
						title: '待评价',
						image: '../../../static/Mine/daipingjia.png',
						num: '20',
					},
					{
						title: '售后/退款',
						image: '../../../static/Mine/tuikuanshouhou.png',
						num: '16',
					}
				],
				list2: [{
						title: '会员中心',
						image: '../../../static/Mine/huiyuan.png',
						url: '/pages/Mine/vip/vip',
					},
					{
						title: '砍价记录',
						image: '../../../static/Mine/kanjia.png',
					},
					{
						title: '我的推广',
						image: '../../../static/Mine/tuiguang.png',
						url: '/pages/Mine/share/share'
					},
					{
						title: '我的余额',
						image: '../../../static/Mine/yue.png',
						url: '/pages/Mine/personal/balance'
					},
					{
						title: '地址信息',
						image: '../../../static/Mine/weizhi.png',
						url: '/pages/Mine/address/index'
					},
					{
						title: '我的收藏',
						image: '../../../static/Mine/shoucang.png',
						url: '/pages/Mine/personal/Collection'
					},
					{
						title: '优惠券',
						image: '../../../static/Mine/youhui.png',
						url: '/pages/shop/coupon',
					}, {
						title: '联系客服',
						image: '../../../static/Mine/kefu.png',
					}
				]
			}
		},
		onLoad() {
			this.getuserDetail()
		},
		methods: {
			myurl(url) {
				console.log(url)
				uni.navigateTo({
					url: url,
					fail(fail) {
						console.log(fail)
					}
				})
			},
			getuserDetail() {
				userdetail().then(res => {
					console.log(res)
					if (res.code == 200) {
						console.log('userdetail', res)
					}
				})
			},
		}

	}
</script>
<style lang="scss" scoped>
	@import "../../../iconfont.scss";

	page {
		background-color: #F5F5F5;
	}

	.section-1 {
		position: relative;
		background-color: #FFF;
		// margin-top: -220rpx;
		border-radius: 12rpx;
		padding: 20rpx 0;
		display: flex;
		margin: 30rpx;
		box-shadow: 0 20rpx 20rpx -20rpx rgba($color: #333, $alpha: 0.1);
		position: absolute;
		z-index: 999;
		top: 120rpx;
		left: 0;
		width: 93%;

		.item {
			flex: 1;
			flex-shrink: 0;
			display: flex;
			flex-direction: column;
			align-items: center;
			position: relative;

			&:nth-child(1):after {
				content: '';
				position: absolute;
				right: 0;
				top: 0;
				bottom: 0;
				width: 2rpx;
				background-color: #c8c7cc;
			}

			&:nth-child(2):after {
				content: '';
				position: absolute;
				right: 0;
				top: 0;
				bottom: 0;
				width: 2rpx;
				background-color: #c8c7cc;
			}

			.text-color-assist {
				color: #AAAAAA;
				font-size: 24rpx;
			}

			.text2 {
				padding: 10rpx;
				color: #282828;
				font-size: 36rpx;
			}
		}
	}
	.tui-mybg-box {
		width: 100%;
		height: 220rpx;
		position: relative;
		background-color: #00C049;
		border-radius: 0 0 10% 10%;

		.tui-header-center {
			position: absolute;
			height: 90rpx;
			padding: 20rpx 30rpx 30rpx 30rpx ;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.avatar {
				height: 126rpx;
				width: 126rpx;
				border-radius: 50%;
				padding: 3.5rpx;
				background-color: #FFFFFF;
				box-sizing: border-box;
				margin: 0 auto;
				box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
				.tui-avatar {
					height: 120rpx;
					width: 120rpx;
					display: block;
					border-radius: 50%;
					box-shadow: 0rpx 5rpx 0rpx #FFFFFF inset;
				}

			}

			

			.headerinfo {
				margin-left: 20rpx;
				color: #FFFFFF;

				.u-flex {
					display: flex;
					align-items: center;
					padding-top: 10rpx;

					.bdphone {
						border-radius: 20rpx;
						width: 160rpx;
						height: 40rpx;
						background-color: #FF8500;
						color: #FFFFFF;
						font-size: 18rpx;
						line-height: 40rpx;
					}
				}

				.headernickname {
					font-size: 30rpx;
					font-weight: 400;
				}

				.headernum {
					padding-left: 350rpx;
					z-index: 999;
					top:-50rpx;
				}
			}
		}
	}
	.section-2 {
		position: relative;
		background-color: #FFF;
		border-radius: 12rpx;
		padding: 0rpx 0rpx 30rpx 0;
		margin: 90rpx 30rpx 30rpx 30rpx;
		box-shadow: 0 20rpx 20rpx -20rpx rgba($color: #333, $alpha: 0.1);

		.header {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-bottom: 20rpx;
			border-bottom: 0.5rpx dashed #DDDDDD;
			padding: 20rpx;

			.headertitle {
				font-size: 32rpx;
				font-weight: 500;
				margin-left: 20rpx;
				color: #282828;
			}

			.subtitle {
				font-size: 24rpx;
				color: #8E8E8E;
				margin-right: 20rpx;
			}
		}

		.row {
			margin-top: 20rpx;
			width: 100%;
			display: flex;
			align-items: center;

			.grid {
				flex: 1;
				flex-shrink: 0;
				display: flex;
				flex-direction: column;
				align-items: center;
				position: relative;
				margin-top: 10rpx;

				.tip {
					display: block;
					top: -10rpx;
					right: 18rpx;
					position: absolute;
					border-radius: 50%;
					border: 1rpx solid #00C049;
					color: #00C049;
					font-size: 20rpx;
				}

				image {
					width: 56rpx;
					height: 56rpx;
				}

				.title {
					font-size: 24rpx;
					color: #666;
					margin-top: 15rpx;
				}
			}
		}
	}

	.section-3 {
		// position: relative;
		background-color: #FFF;
		margin-top: -60rpx;
		border-radius: 12rpx;
		padding: 0rpx 0rpx 30rpx 0;
		// display: flex;
		margin: 30rpx;
		box-shadow: 0 20rpx 20rpx -20rpx rgba($color: #333, $alpha: 0.1);

		.header3 {
			display: flex;
			justify-content: space-between;
			align-items: center;
			// margin-bottom: 20rpx;
			border-bottom: 1.5rpx dashed #DDDDDD;
			padding: 20rpx;

			// height: 400rpx;
			.headertitle3 {
				font-size: 32rpx;
				font-weight: 500;
				margin-left: 20rpx;
				color: #282828;
			}
		}

		.row3 {
			margin-top: 20rpx;
			width: 100%;
			display: flex;
			align-items: center;
			flex-wrap: wrap;

			.grid3 {
				display: flex;
				flex-direction: column;
				align-items: center;
				width: 25%;
				justify-content: flex-start;

				image {
					width: 60rpx;
					height: 60rpx;
				}

				.title3 {
					font-size: 24rpx;
					color: #666;
					margin-top: 15rpx;
					margin-bottom: 15rpx;
				}
			}
		}

	}
</style>
